package br.com.playonline.rest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import br.com.playonline.bussines.EnderecoBU;
import br.com.playonline.bussines.UsuarioBU;
import br.com.playonline.domain.Endereco;
import br.com.playonline.dto.UsuarioDTO;

@RestController
@RequestMapping(value = "/usuario")
public class UsuarioRest {

	@Autowired
	UsuarioBU usuarioBU;
	
	
	@RequestMapping(value = "/inserir",method = RequestMethod.POST)
	public @ResponseBody void inserirUsuario(@RequestBody UsuarioDTO usuarioDTO){
//		usuarioBU.saveUser(usuarioDTO);
		this.usuarioBU.save(usuarioDTO);
	}
	
	@RequestMapping(value = "/teste",method = RequestMethod.GET)
	public @ResponseBody String entrou(){
		System.out.println("oi");
		return "oi";
	}
	
}
